#!/bin/bash
while((1==1))
do
n=`ps -ef |grep 'ssh -N' |wc -l`
if [[ $n -ge 2 ]];then
echo "`date`,is OK!"
else
echo "`date`,is Fail!"
ssh -N -f -R 8022:localhost:22 198.56.248.144
fi
sleep 5
done
